﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <script src="~/vue/vue.js"></script>
    <script src="~/element-ui/index.js"></script>
    <link href="~/element-ui/theme-chalk/index.css" rel="stylesheet" />
    <script src="~/vue/vue-resource.js"></script>
    <script src="~/lib/jquery/dist/jquery.js"></script>
    <title>Index3</title>

</head>
<body>
    <div id="app">
        <div style="z-index:-1;position:absolute">
            <img src="~/Img/2028280.jpg" style="width:1903px;height:920px" />
        </div>
        <div style="height:500px;width:400px;background-color:red;
         z-index:1;background:#130f27;opacity:0.5;
         position:absolute;margin-left:750px;margin-top:170px;">
            <el-form ref="form" :model="form" label-width="80px" style="margin-top:100px;margin-right:40px;font-size: 18px">
                <el-form-item label="账号">
                    <el-input v-model="form.name"></el-input>
                </el-form-item>
                <el-form-item label="密码" style="padding-top:20px">
                    <el-input type="password" v-model="form.pwd"></el-input>
                </el-form-item>
                <el-button type="primary" round style="margin-left:180px;margin-top:40px" @@click="login">登录</el-button>
            </el-form>
        </div>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: "#app",
            data() {
                return {
                    form: {
                        name: '',
                        pwd: ''
                    }
                }
            },  
            methods: {
                login() {
                    var url = 'http://localhost:62874/api/Login/LoginIndex';
                    this.$http.get(url, { params: { EmployeeAccount: this.form.name, PassWords: this.form.pwd } }).then(function (result) {
                        if (result.data > 0) {
                            alert("登陆成功");
                            window.location.href = "/MvcController1/Index1";
                        }
                        else
                        {
                            alert("登陆失败");
                            window.location.href = "/MvcController1/Index3";
                        }
                    });
                },
            }
        })
    </script>
</body>
</html>